<template>
  <div class="padding-lr">
    <div class="text-right">
      <el-button type="success" size="mini" @click="save">
        保存
      </el-button>
    </div>

      <el-row :gutter="10"  class="margin-top">
        <el-col :span="2">
          备注:
        </el-col>
        <el-col :span="20">
          <el-input
            type="textarea"
            v-model="remark"
            :rows="5"
            size="mini"
            clearable
          />
        </el-col>
      </el-row>
  </div>
</template>
<script>
import { ajax } from "@/store/yg/common/utils";
import Row from "../../../../yg/layout/main/page/wrapper/form/Row";

export default {
  components: { Row },
  data() {
    return {
      remark: '',
      pid: '',
    };
  },
  mounted() {
      this.pid = this.$store.state.edit.id;
      this.remark = this.$store.state.edit.row.remark;
  },
  methods: {
    async save() {
      if(!this.remark){
        this.$message.error("请输入备注");
        return ;
      }
      ajax("updateCustomerRemark", {id:this.pid,remark:this.remark}, {
        class: "com.tofba.app.client.customer.CustomerInfoClient"
      }).then(
        res => {
          if (res.code==200){
            this.$message.success("保存成功");
          } else {
            this.$message.error("保存失败");
          }
        },
        error => {
          console.log(error);
        }
      );
    }
  }
};
</script>

<style scoped>
/deep/ .el-select {
  width: 100%;
}
.btn-group {
  float: right;
}
</style>
